﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace battlenet.wow.rt.domain.objects
{
    public class AuctionItem
    {
        public long AuctionId { get; set; }

        // TODO: perhaps implment a lazy load getter for the actual item detals?
        public long ItemId { get; set; }

        public string Owner { get; set; }

        public string OwnerRealm { get; set; }

        public Price Bid { get; set; }

        public Price Buyout { get; set; }

        public int Quantity { get; set; }

        public AuctionLengthType TimeLeft { get; set; }

        public long Rand { get; set; }

        public long Seed { get; set; }

        public long Context { get; set; }
    }

    public class AuctionItemCollection : List<AuctionItem>
    {
        public AuctionItemCollection(IEnumerable<AuctionItem> items)
        {
            var auctionItems = items as AuctionItem[] ?? items.ToArray();
            if (auctionItems.IsNullOrEmpty()) return;
            AddRange(auctionItems);
        }
    }
}
